package com.xzlf.conttoller;

import com.xzlf.config.R;
import com.xzlf.dto.ItemDTO;
import com.xzlf.entity.TbItem;
import com.xzlf.service.TbItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/item")
public class ItemController {

    @Autowired
    private TbItemService tbItemService;

    @PostMapping("/list")
    public R<List<TbItem>> list(@RequestBody ItemDTO itemDTO){
        List<TbItem> list = tbItemService.list(itemDTO);
        return R.ok(list);
    }
}
